class Person:
    def __init__(self, name, sex, age, balance, brand, battery, screensize, standby, credit):
        self.__name = name
        self.__sex = sex
        self.__age: int = age
        self.__balance: float = balance
        self.__brand = brand
        self.__battery = battery
        self.__screensize = screensize
        self.__standby = standby
        self.__credit: int = credit

    def texting(self):
        message = input("请输入短信：")
        print(f"发出短信内容为：{message}")

    def call(self):
        phone = input("请输入电话：")
        times = int(input("请输入时间："))
        if self.__balance < 1 or phone is not None:
            return False
        else:
            if times in range(0, 11):
                for t in range(1, 11):
                    self.__balance -= t
                    self.__credit += t * 15
            elif times in range(12, 21):
                for t in range(12, 21):
                    self.__balance -= t * 0.8
                    self.__credit += t * 39
            elif times >= 21:
                self.__balance -= (times - 21) * 0.65
                self.__credit += (times - 21) * 48
            print(f"您的话费余额还剩：{self.__balance}，您获得{self.__credit}个积分！")


person = Person('john', 'nan', 32, 78.0, '小米', '30000', '250*250', '15h', 20)
person.texting()
person.call()
